Lambda expression
- 网络lambda表达式;λ表达式;匿名函数
-
Using a lambda expression , we can make this more compact
在使用lambda表达式时,可以使代码更加简洁
-
The first line defines a lambda expression and binds it to the symbol total .
第一行代码定义了一个lambda表达式并将其和total符号绑定到一起。
-
Parameters : Retrieve the parameters of the lambda expression .
Parameters:获取Lambda表达示的参数;
-
Finally , the last expression applies the lambda expression to the list containing ( 101102 ) .
最终,最后一个表达式对包含(101102)的列表应用这个lambda表达式。
-
The lambda expression simply dumps the data from the custom event into the stories collection .
lambda表达式仅将来自定制事件的数据转储到新闻集合中。
-
Perhaps the most common use of higher-order functions is the lambda expression , which is Lisp 's version of a closure .
高阶函数的最常见用法或许是lambda表达式,这是闭包的Lisp版。
-
In this particular example , a method reference is a clearer expression of what we mean than a lambda expression , but the idea is the same .
在这个特殊的示例中,与lambda表达式相比,方法引用更清楚地表达出了我们想要表达的东西,但表达的意思是相同的。
-
An expression tree is a data representation of the lambda expression in a form that is easy for you to read and reason about the lambda expression in .
表达式树是lambda表达式的一种数据表示形式,它能使你更方便地读取和推断Lambda表达式。
-
Therefore , when you issue a query over a type that is queryable , the compiler will generate an expression tree rather than a lambda expression .
因此,当你生成一个带IQueryable类型查询的时候,编译器将生成一个表达式树而不是Lambda表达式。
-
Because the lambda expression has the right argument and return types , the compiler verifies that it can be converted into a Comparator and generates the appropriate code for doing so .
因为lambda表达式拥有正确的参数和返回类型,编译器将证实可以把这些类型转换成Comparator,并生成完成此操作的相应代码。
-
Here , the first lambda expression is the mapper ( mapping each element to its size ), and the second lambda expression is the reducer , which takes two sizes and adds them .
这里,第一个lambda表达式是映射器(将每个元素映射到它的大小),第二个lambda表达式是一个减法器,它获取两个大小并相加。
-
If capture of mutable locals were allowed , the platform would need to extend the local variable 's lifetime for as long as the dynamic lifetime of any lambda expression that captures it .
如果允许捕获易变局部变量,该平台将需要将局部变量的生命周期延长到任何捕获它的lambda表达式的动态生命周期。
-
But allowing mutable locals to be captured by lambda expression elevates them to behaving like fields , not locals invisibly and thereby exposes them to the hazards of data races .
通过允许lambda表达式捕获易变的局部变量,会使它们的行为类似于字段,而不是不可见的局部变量,进而将它们暴露在数据竞争的危险之中。